#pragma once

#include <vector>
#include <map>
#include <string>

#define MAX_WP_BOX 1
#define MAX_CL_BOX 1
#define MAX_SOUND_NAME 32
struct Frame
{
	Frame()
	{
		memset(this, 0, sizeof(Frame));
		frametime = 0;
		texid = -1;
		memset( collisionbox, 0, sizeof(RECT)*MAX_CL_BOX );
		memset( weaponbox, 0, sizeof(RECT)*MAX_WP_BOX );
		ustart=vstart=0.0f;
		uend=vend=1.0f;
	}
	int frametime;
	int texid;
	float ustart;
	float vstart;
	float uend;
	float vend;
	RECT collisionbox[MAX_CL_BOX];
	RECT weaponbox[MAX_WP_BOX];
	int offsetx;
	int offsety;
	char sound[MAX_SOUND_NAME];
};

typedef std::vector<Frame> FrameVec;
class Animation
{
public:
	enum{ONCE=0,LOOP,};
	Animation();
	~Animation();
	void Update( int diff );
	void Render( int x, int y/*, int w, int h*/ );
	void Start();
	FrameVec mFrames;
	int mPlaytype;
	int mCurframe;
	int mPassed;
	char mInterpolated;
	std::string mName;
};
typedef std::map<std::string, Animation*> AnimMap;
class AnimSet
{
public:
	AnimMap mAnims;
};